//
//  HEAssesRecodeCell.m
//  HealthFamily
//
//  Created by LOOK on 2020/12/27.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEAssesRecodeCell.h"

@interface HEAssesRecodeCell ()

@property (nonatomic, strong) UILabel *timeLb;
@property (nonatomic, strong) UILabel *contentLb;

@end

@implementation HEAssesRecodeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = KWhiteColor;
        
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    _timeLb = [[UILabel alloc] init];
    _timeLb.font = DYFont(15);
    _timeLb.text = @"2020-12-11 15:11";
    _timeLb.textColor = CNavLightBlackColor;
    [self.contentView addSubview:_timeLb];
    
    UILabel *docName = [[UILabel alloc] init];
    docName.font = DYFont(15);
    docName.text = @"评估医生：";
    docName.textColor = CNavLightBlackColor;
    [self.contentView addSubview:docName];
    
    _contentLb = [[UILabel alloc] init];
    _contentLb.font = DYFont(15);
    _contentLb.text = @"张医生";
    _contentLb.textColor = CNavLightBlackColor;
    _contentLb.numberOfLines = 0;
    [self.contentView addSubview:_contentLb];
    
    
    [_timeLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(self.contentView).mas_offset(15);
        make.right.equalTo(self.contentView).mas_offset(-15);
    }];
    
    [docName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_timeLb.mas_bottom).mas_offset(5);
        make.left.equalTo(self.contentView).mas_offset(15);
    }];
    [docName setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
    
    [_contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_timeLb.mas_bottom).mas_offset(5);
        make.left.equalTo(docName.mas_right).mas_offset(5);
        make.right.equalTo(self.contentView).mas_offset(-15);
        make.bottom.equalTo(self.contentView).mas_offset(-15);
    }];
}

- (void)setModel:(HEAssesReportModel *)model {
    _timeLb.text = model.KCreateDate;
    _contentLb.text = model.record_name;
}

@end
